<template>
	<Theme>
	<Detail>
		<view class="fdc fac bgw twb">
			<view class="h14"/>
			<view class="f" v-if="state==2">
				<u-icon name="checkmark-circle-fill" class="fc-success fs36" />
				<text class="fc-success ml2 fs36 tsn">支付成功</text>
			</view>
			<view class="f" v-else>
				<u-icon name="close-circle-fill" class="fc-red fs36" />
				<text class="fc-red ml2 fs36 tsn">支付失败</text>
			</view>
			<view v-if="pay_fee" class="pl2 fae cb mt6">
				<text class="fs40 lh44">￥</text>
				<text class="fs60 lh60">{{filter.number(pay_fee / 100)}}</text>
			</view>
		</view>
		<view class="h12 bgw"/>
		<view class="pb8 bgw fjc">
			<button class="px8" type="info" @click="rdrto(home)" :hair-line="false">返回首页</button>
			<button class="ml8 px8" type="primary" @click="rdrto(route)" :hair-line="false">查看订单</button>
		</view>
		<view class="mt4">
			<view class="py6 tac bgw">精选推荐</view>
			<view class="fww">
				<view @click="navto('item/view', {id:item.id})" class="col-2 bgw mt3 br3 fdc" v-for="(item, i) in list" :key="i">
					<image :lazy-load="true" :src="filter.image(item.thumb)" class="wt h36 br3"/>
					<view class="px4 h8 tl2 pt2">【{{filter.country(item.home)}}】{{item.name}}{{item.spec}}</view>
					<view class="fc-green fs34 py2 px4"><text class="fs20">￥</text> {{filter.number(item.price/100)}}</view>
				</view>
			</view>
		</view>
	</Detail>
	</Theme>
</template>

<script lang="ts">
import util from '@/utils/util'
import {page,list} from '@/mixins'

export default {
	mixins: [page,list],
	data() {
		return {
			meta:{title:'支付结果'},
			pay_fee:'', 
			state: 0,
			route: '',
			home: '',
			payStart: false
		}
	},
	onLoad(querys) {
		const i = querys.id[16]
		this.route = ['my','my','store/buy','store/buy'][i] + '/order/index'
		this.home = ['index', 'index', 'stob/index', 'stob/index'][i]
		this.load(['my/order','my/combine','store/buy.order','store/buy.combine'][i] + '/result/' + querys.id.substr(0, 16)).then(res => {
			this.state = res.state
			this.loadstate == 2
		}).catch(e=>{
			this.loadstate == 2
		})
	}
}
</script>
